home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / languages / c / _desklibsm / h / popup < prev    next >
Encoding:
Text File  |  1993-05-26  |  3.6 KB  |  151 lines

  1.  
  2. #ifndef __dl_popup_h
  3. #define __dl_popup_h
  4. #ifndef __dl_wimp_h
  5. #include "Wimp.h"
  6. #endif
  7. typedef int popup_handle;
  8. #define popup_ISLEAF   (0x01)
  9. #define popup_ISSTATIC (0x02)
  10. #define popup_STANDALONE (0x00)
  11. #define popup_MENULEAF   (0x01)
  12. #define popup_STATIC     (0x02)
  13. typedef struct
  14. {
  15.   int mul, div;
  16.   int minmul, maxmul;
  17.   int mindiv, maxdiv;
  18. } popup_magnify;
  19. typedef struct
  20. {
  21.   char appname[32];
  22.   char purpose[32];
  23.   char author[32];
  24.   char version[32];
  25. } popup_proginfo;
  26. typedef struct
  27. {
  28.   struct
  29.   {
  30.     unsigned int cancel     : 1;    
  31.     unsigned int ok         : 1;    
  32.     unsigned int reserved   : 6;
  33.     unsigned int userhandle : 24;   
  34.   } flags;
  35.   char oktext[12];                  
  36.   char canceltext[12];              
  37.   char appname[12];                 
  38.   char message[188];                
  39. } popup_report;
  40. typedef struct
  41. {
  42.   char iconsprite[12];              
  43.   char filename[212];               
  44. } popup_saveas;                     
  45. typedef struct
  46. {
  47.   struct
  48.   {                                
  49.     unsigned int wasdragged : 1;   
  50.     unsigned int shiftdown  : 1;   
  51.     unsigned int reserved   : 30;
  52.   } flags;
  53.   int  reserved;
  54.   char filename[212];              
  55. } popup_saveasreturn;
  56. typedef struct
  57. {
  58.   char colour;                     
  59. } popup_wimpcolour;
  60. typedef struct
  61. {
  62.   unsigned int transparency : 8;
  63.   unsigned int red          : 8;
  64.   unsigned int green        : 8;
  65.   unsigned int blue         : 8;
  66. } colour_rgb;
  67. typedef struct
  68. {
  69.   unsigned int value        : 8;    
  70.   unsigned int saturation   : 8;    
  71.   unsigned int hue          : 16;   
  72. } colour_hsv;
  73. typedef struct
  74. {
  75.   unsigned int key          : 8;
  76.   unsigned int yellow       : 8;
  77.   unsigned int magenta      : 8;
  78.   unsigned int cyan         : 8;
  79. } colour_cmyk;
  80. #define popuptc_RGB  0
  81. #define popuptc_HSV  1
  82. #define popuptc_CMYK 2
  83. #define popuptc_TRANSPARENT0   0x00000
  84. #define popuptc_TRANSPARENT1   0x10000
  85. #define popuptc_TRANSPARENT256 0x20000
  86. typedef struct
  87. {
  88.   int colourmodel;                
  89.   union
  90.   {
  91.     colour_rgb  rgb;
  92.     colour_hsv  hsv;
  93.     colour_cmyk cmyk;
  94.   } colour;
  95.   
  96.   int transparency;                 
  97. } popup_truecolour;
  98. typedef struct
  99. {
  100.   char       name[12];              
  101.   wimp_point openpos;               
  102.   char       flags;                 
  103.   char       reserved1, reserved2, reserved3;
  104. } popup_header;
  105. typedef union
  106. {
  107.   popup_magnify    magnify;
  108.   popup_proginfo   proginfo;
  109.   popup_report     report;
  110.   popup_saveas     saveas;
  111.   popup_wimpcolour wimpcolour;
  112.   popup_truecolour truecolour;
  113. } popup_data;                               
  114. typedef struct
  115. {
  116.   popup_magnify    magnify;
  117.   popup_report     report;
  118.   popup_saveas     saveasreturn;
  119.   popup_wimpcolour wimpcolour;
  120.   popup_truecolour truecolour;
  121. } popup_returndata;                     
  122. typedef struct
  123. {
  124.   window_handle window;                
  125.   wimp_point    openpos;               
  126. } message_popuprequest;
  127. typedef struct
  128. {
  129.   popup_handle     handle;                
  130.   char             name[12];              
  131.   popup_returndata data;                  
  132. } message_popupstate;
  133. typedef struct
  134. {
  135.   popup_header header;
  136.   popup_data   data;
  137. } popup_block;                                
  138.   
  139. extern popup_handle PopUp_Open(popup_block *params);
  140.   
  141. extern void PopUp_Close(popup_handle handle);
  142.  
  143. extern popup_handle PopUp_ShowMenuLeaf(char *name, popup_data *definition,
  144.                                        message_menuwarn *msg);
  145.  
  146. extern popup_handle PopUp_ShowPtr(char *name, BOOL isstatic,
  147.                                   popup_data *definition);
  148. #define PopUp_ShowStandalone(N, D) PopUp_ShowPtr(N, 0, D)
  149. #define PopUp_ShowStatic(N, D) PopUp_ShowPtr(N, 1, D)
  150. #endif
  151.